<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JSDoc: Class: Key</title>

    <script src="scripts/prettify/prettify.js"> </script>
    <script src="scripts/prettify/lang-css.js"> </script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

    <h1 class="page-title">Class: Key</h1>

    




<section>

<header>
    
        <h2><span class="attribs"><span class="type-signature"></span></span>Key<span class="signature">()</span><span class="type-signature"></span></h2>
        
            <div class="class-description"><p>Abstract class that represents an OpenPGP key. Must contain a primary key.
Can contain additional subkeys, signatures, user ids, user attributes.</p></div>
        
    
</header>

<article>
    <div class="container-overview">
    
        

    
    <h2>Constructor</h2>
    

    
    <h4 class="name" id="Key"><span class="type-signature"></span>new Key<span class="signature">()</span><span class="type-signature"></span></h4>
    

    















<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js">key/key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js#L49">line 49</a>
    </li></ul></dd>
    

    

    

    
</dl>




















    
    </div>

    

    

    

    

    

    

    

    
        <h3 class="subsection-title">Methods</h3>

        
            

    

    
    <h4 class="name" id="applyRevocationCertificate"><span class="type-signature">(async) </span>applyRevocationCertificate<span class="signature">(revocationCertificate, date<span class="signature-attributes">opt</span>, config<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="Key.html">Key</a>>}</span></h4>
    

    



<div class="description">
    <p>Applies a revocation certificate to a key
This adds the first signature packet in the armored text to the key,
if it is a valid revocation signature.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>revocationCertificate</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>armored revocation certificate</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>date</code></td>
            

            <td class="type">
            
                
<span class="param-type">Date</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Date to verify the certificate</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>config</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Full configuration, defaults to openpgp.config</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js">key/key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js#L643">line 643</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>Revoked key.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise.&lt;<a href="Key.html">Key</a>></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="clone"><span class="type-signature"></span>clone<span class="signature">(clonePrivateParams<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="Key.html">Key</a>>}</span></h4>
    

    



<div class="description">
    <p>Clones the key object. The copy is shallow, as it references the same packet objects as the original. However, if the top-level API is used, the two key instances are effectively independent.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>clonePrivateParams</code></td>
            

            <td class="type">
            
                
<span class="param-type">Boolean</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    false
                
                </td>
            

            <td class="description last"><p>Only relevant for private keys: whether the secret key paramenters should be deeply copied. This is needed if e.g. <code>encrypt()</code> is to be called either on the clone or the original key.</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js">key/key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js#L176">line 176</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>Clone of the key.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise.&lt;<a href="Key.html">Key</a>></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="getAlgorithmInfo"><span class="type-signature"></span>getAlgorithmInfo<span class="signature">()</span><span class="type-signature"> &rarr; {Object}</span></h4>
    

    



<div class="description">
    <p>Returns algorithm information</p>
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js#L271">line 271</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>An object of the form {algorithm: String, bits:int, curve:String}.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Object</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="getCreationTime"><span class="type-signature"></span>getCreationTime<span class="signature">()</span><span class="type-signature"> &rarr; {Date}</span></h4>
    

    



<div class="description">
    <p>Returns the creation time of the key</p>
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js#L199">line 199</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Date</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="getEncryptionKey"><span class="type-signature">(async) </span>getEncryptionKey<span class="signature">(keyID<span class="signature-attributes">opt</span>, date<span class="signature-attributes">opt</span>, userID<span class="signature-attributes">opt</span>, config<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;(<a href="Key.html">Key</a>|Subkey)>}</span></h4>
    

    



<div class="description">
    <p>Returns last created key or key by given keyID that is available for encryption or decryption</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>keyID</code></td>
            

            <td class="type">
            
                
<span class="param-type">module:type/keyid~KeyID</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>key ID of a specific key to retrieve</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>date</code></td>
            

            <td class="type">
            
                
<span class="param-type">Date</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>use the fiven date date to  to check key validity instead of the current date</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>userID</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>filter keys for the given user ID</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>config</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Full configuration, defaults to openpgp.config</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js">key/key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js#L324">line 324</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Throws:</h5>

        

    <div class="param-desc">
    
        <p>if no valid encryption key was found</p>
    
    </div>


    


<h5>Returns:</h5>

        
<div class="param-desc">
    <p>encryption key</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise.&lt;(<a href="Key.html">Key</a>|Subkey)></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="getExpirationTime"><span class="type-signature">(async) </span>getExpirationTime<span class="signature">(userID<span class="signature-attributes">opt</span>, config<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;(Date|Infinity|null)>}</span></h4>
    

    



<div class="description">
    <p>Returns the expiration date of the primary key, considering self-certifications and direct-key signatures.
Returns <code>Infinity</code> if the key doesn't expire, or <code>null</code> if the key is revoked or invalid.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>userID</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>User ID to consider instead of the primary user</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>config</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Full configuration, defaults to openpgp.config</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js">key/key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js#L428">line 428</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise.&lt;(Date|Infinity|null)></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="getFingerprint"><span class="type-signature"></span>getFingerprint<span class="signature">()</span><span class="type-signature"> &rarr; {String}</span></h4>
    

    



<div class="description">
    <p>Calculates and returns the fingerprint of the key, as a string</p>
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js#L255">line 255</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>A string containing the fingerprint in lowercase hex</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">String</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="getKeyID"><span class="type-signature"></span>getKeyID<span class="signature">()</span><span class="type-signature"> &rarr; {module:type/keyid~KeyID}</span></h4>
    

    



<div class="description">
    <p>Return the key ID of the key</p>
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js#L207">line 207</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>The 8-byte key ID</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">module:type/keyid~KeyID</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="getKeyIDs"><span class="type-signature"></span>getKeyIDs<span class="signature">()</span><span class="type-signature"> &rarr; {Array.&lt;module:type/keyid~KeyID>}</span></h4>
    

    



<div class="description">
    <p>Returns key IDs of all keys</p>
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js">key/key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js#L228">line 228</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Array.&lt;module:type/keyid~KeyID></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="getKeys"><span class="type-signature"></span>getKeys<span class="signature">(keyID<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Array.&lt;(<a href="Key.html">Key</a>|Subkey)>}</span></h4>
    

    



<div class="description">
    <p>Returns an array containing all public or private keys matching keyID.
If no keyID is given, returns all keys, starting with the primary key.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>keyID</code></td>
            

            <td class="type">
            
                
<span class="param-type">type/keyid~KeyID</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    null
                
                </td>
            

            <td class="description last"><p>key ID to look for</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js">key/key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js#L216">line 216</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>array of keys</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Array.&lt;(<a href="Key.html">Key</a>|Subkey)></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="getPrimarySelfSignature"><span class="type-signature">(async) </span>getPrimarySelfSignature<span class="signature">(date<span class="signature-attributes">opt</span>, userID<span class="signature-attributes">opt</span>, config<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="SignaturePacket.html">SignaturePacket</a>>}</span></h4>
    

    



<div class="description">
    <p>For V4 keys, returns the self-signature of the primary user.
For V5 keys, returns the latest valid direct-key self-signature.
This self-signature is to be used to check the key expiration,
algorithm preferences, and so on.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>date</code></td>
            

            <td class="type">
            
                
<span class="param-type">Date</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Use the given date for verification instead of the current time</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>userID</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>User ID to get instead of the primary user for V4 keys, if it exists</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>config</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Full configuration, defaults to openpgp.config</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js">key/key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js#L465">line 465</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>The primary self-signature</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise.&lt;<a href="SignaturePacket.html">SignaturePacket</a>></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="getPrimaryUser"><span class="type-signature">(async) </span>getPrimaryUser<span class="signature">(date<span class="signature-attributes">opt</span>, userID<span class="signature-attributes">opt</span>, config<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;{user: User, selfCertification: <a href="SignaturePacket.html">SignaturePacket</a>}>}</span></h4>
    

    



<div class="description">
    <p>Returns primary user and most significant (latest valid) self signature</p>
<ul>
<li>if multiple primary users exist, returns the one with the latest self signature</li>
<li>otherwise, returns the user with the latest self signature</li>
</ul>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>date</code></td>
            

            <td class="type">
            
                
<span class="param-type">Date</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Use the given date for verification instead of the current time</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>userID</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>User ID to get instead of the primary user, if it exists</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>config</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Full configuration, defaults to openpgp.config</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js">key/key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js#L489">line 489</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>The primary user and the self signature</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise.&lt;{user: User, selfCertification: <a href="SignaturePacket.html">SignaturePacket</a>}></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="getRevocationCertificate"><span class="type-signature">(async) </span>getRevocationCertificate<span class="signature">(date, config<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;String>}</span></h4>
    

    



<div class="description">
    <p>Get revocation certificate from a revoked key.
(To get a revocation certificate for an unrevoked key, call revoke() first.)</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>date</code></td>
            

            <td class="type">
            
                
<span class="param-type">Date</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>Use the given date instead of the current time</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>config</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Full configuration, defaults to openpgp.config</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js">key/key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js#L623">line 623</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>Armored revocation certificate.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise.&lt;String></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="getSigningKey"><span class="type-signature">(async) </span>getSigningKey<span class="signature">(keyID<span class="signature-attributes">opt</span>, date<span class="signature-attributes">opt</span>, userID<span class="signature-attributes">opt</span>, config<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;(<a href="Key.html">Key</a>|Subkey)>}</span></h4>
    

    



<div class="description">
    <p>Returns last created key or key by given keyID that is available for signing and verification</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>keyID</code></td>
            

            <td class="type">
            
                
<span class="param-type">module:type/keyid~KeyID</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    null
                
                </td>
            

            <td class="description last"><p>key ID of a specific key to retrieve</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>date</code></td>
            

            <td class="type">
            
                
<span class="param-type">Date</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>use the fiven date date to  to check key validity instead of the current date</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>userID</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>filter keys for the given user ID</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>config</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>Full configuration, defaults to openpgp.config</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js">key/key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js#L260">line 260</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Throws:</h5>

        

    <div class="param-desc">
    
        <p>if no valid signing key was found</p>
    
    </div>


    


<h5>Returns:</h5>

        
<div class="param-desc">
    <p>signing key</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise.&lt;(<a href="Key.html">Key</a>|Subkey)></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="getSubkeys"><span class="type-signature"></span>getSubkeys<span class="signature">(keyID<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Array.&lt;Subkey>}</span></h4>
    

    



<div class="description">
    <p>Returns an array containing all public or private subkeys matching keyID;
If no keyID is given, returns all subkeys.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>keyID</code></td>
            

            <td class="type">
            
                
<span class="param-type">type/keyID</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    null
                
                </td>
            

            <td class="description last"><p>key ID to look for</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js">key/key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js#L203">line 203</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>array of subkeys</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Array.&lt;Subkey></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="getUserIDs"><span class="type-signature"></span>getUserIDs<span class="signature">()</span><span class="type-signature"> &rarr; {Array.&lt;string>}</span></h4>
    

    



<div class="description">
    <p>Returns userIDs</p>
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js">key/key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js#L236">line 236</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>Array of userIDs.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Array.&lt;string></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="hasSameFingerprintAs"><span class="type-signature"></span>hasSameFingerprintAs<span class="signature">()</span><span class="type-signature"> &rarr; {Boolean}</span></h4>
    

    



<div class="description">
    <p>Calculates whether two keys have the same fingerprint without actually calculating the fingerprint</p>
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js#L263">line 263</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>Whether the two keys have the same version and public key data.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Boolean</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="isRevoked"><span class="type-signature">(async) </span>isRevoked<span class="signature">(signature, key,, date<span class="signature-attributes">opt</span>, config<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;Boolean>}</span></h4>
    

    



<div class="description">
    <p>Checks if a signature on a key is revoked</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>signature</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="SignaturePacket.html">SignaturePacket</a></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>The signature to verify</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>key,</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="PublicSubkeyPacket.html">PublicSubkeyPacket</a></span>
|

<span class="param-type"><a href="SecretSubkeyPacket.html">SecretSubkeyPacket</a></span>
|

<span class="param-type"><a href="PublicKeyPacket.html">PublicKeyPacket</a></span>
|

<span class="param-type"><a href="SecretKeyPacket.html">SecretKeyPacket</a></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>optional The key to verify the signature</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>date</code></td>
            

            <td class="type">
            
                
<span class="param-type">Date</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Use the given date for verification, instead of the current time</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>config</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Full configuration, defaults to openpgp.config</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js">key/key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js#L381">line 381</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>True if the certificate is revoked.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise.&lt;Boolean></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="packetListToStructure"><span class="type-signature"></span>packetListToStructure<span class="signature">(packetlist, disallowedPackets)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Transforms packetlist to structured key data</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>packetlist</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="PacketList.html">PacketList</a></span>


            
            </td>

            

            

            <td class="description last"><p>The packets that form a key</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>disallowedPackets</code></td>
            

            <td class="type">
            
                
<span class="param-type">Set.&lt;enums.packet></span>


            
            </td>

            

            

            <td class="description last"><p>disallowed packet tags</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js">key/key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js#L55">line 55</a>
    </li></ul></dd>
    

    

    

    
</dl>




















        
            

    

    
    <h4 class="name" id="signAllUsers"><span class="type-signature">(async) </span>signAllUsers<span class="signature">(privateKeys, date<span class="signature-attributes">opt</span>, config<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="Key.html">Key</a>>}</span></h4>
    

    



<div class="description">
    <p>Signs all users of key</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>privateKeys</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array.&lt;<a href="PrivateKey.html">PrivateKey</a>></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>decrypted private keys for signing</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>date</code></td>
            

            <td class="type">
            
                
<span class="param-type">Date</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Use the given date for signing, instead of the current time</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>config</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Full configuration, defaults to openpgp.config</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js">key/key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js#L688">line 688</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>Key with new certificate signature.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise.&lt;<a href="Key.html">Key</a>></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="signPrimaryUser"><span class="type-signature">(async) </span>signPrimaryUser<span class="signature">(privateKeys, date<span class="signature-attributes">opt</span>, userID<span class="signature-attributes">opt</span>, config<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="Key.html">Key</a>>}</span></h4>
    

    



<div class="description">
    <p>Signs primary user of key</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>privateKeys</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array.&lt;<a href="PrivateKey.html">PrivateKey</a>></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>decrypted private keys for signing</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>date</code></td>
            

            <td class="type">
            
                
<span class="param-type">Date</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Use the given date for verification instead of the current time</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>userID</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>User ID to get instead of the primary user, if it exists</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>config</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Full configuration, defaults to openpgp.config</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js">key/key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js#L672">line 672</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>Key with new certificate signature.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise.&lt;<a href="Key.html">Key</a>></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="toPacketList"><span class="type-signature"></span>toPacketList<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="PacketList.html">PacketList</a>}</span></h4>
    

    



<div class="description">
    <p>Transforms structured key data to packetlist</p>
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js">key/key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js#L161">line 161</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>The packets that form a key.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="PacketList.html">PacketList</a></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="update"><span class="type-signature">(async) </span>update<span class="signature">(sourceKey, date<span class="signature-attributes">opt</span>, config<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="Key.html">Key</a>>}</span></h4>
    

    



<div class="description">
    <p>Update key with new components from specified key with same key ID:
users, subkeys, certificates are merged into the destination key,
duplicates and expired signatures are ignored.</p>
<p>If the source key is a private key and the destination key is public,
a private key is returned.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>sourceKey</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Key.html">Key</a></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>Source key to merge</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>date</code></td>
            

            <td class="type">
            
                
<span class="param-type">Date</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Date to verify validity of signatures and keys</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>config</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Full configuration, defaults to openpgp.config</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js">key/key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js#L548">line 548</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>updated key</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise.&lt;<a href="Key.html">Key</a>></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="verifyAllUsers"><span class="type-signature">(async) </span>verifyAllUsers<span class="signature">(verificationKeys<span class="signature-attributes">opt</span>, date<span class="signature-attributes">opt</span>, config<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;{userID: String, keyID: module:type/keyid~KeyID, valid: (Boolean|null)}>>}</span></h4>
    

    



<div class="description">
    <p>Verifies all users of key</p>
<ul>
<li>if no arguments are given, verifies the self certificates;</li>
<li>otherwise, verifies all certificates signed with given keys.</li>
</ul>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>verificationKeys</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array.&lt;<a href="PublicKey.html">PublicKey</a>></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>array of keys to verify certificate signatures</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>date</code></td>
            

            <td class="type">
            
                
<span class="param-type">Date</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Use the given date for verification instead of the current time</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>config</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Full configuration, defaults to openpgp.config</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js">key/key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js#L735">line 735</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>List of userID, signer's keyID and validity of signature.
Signature validity is null if the verification keys do not correspond to the certificate.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise.&lt;Array.&lt;{userID: String, keyID: module:type/keyid~KeyID, valid: (Boolean|null)}>></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="verifyPrimaryKey"><span class="type-signature">(async) </span>verifyPrimaryKey<span class="signature">(date<span class="signature-attributes">opt</span>, userID<span class="signature-attributes">opt</span>, config<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Verify primary key. Checks for revocation signatures, expiration time
and valid self signature. Throws if the primary key is invalid.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>date</code></td>
            

            <td class="type">
            
                
<span class="param-type">Date</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Use the given date for verification instead of the current time</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>userID</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>User ID</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>config</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Full configuration, defaults to openpgp.config</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js">key/key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js#L396">line 396</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Throws:</h5>

        

<dl>
    <dt>
        <div class="param-desc">
        <p>If key verification failed</p>
        </div>
    </dt>
    <dd></dd>
    <dt>
        <dl>
            <dt>
                Type
            </dt>
            <dd>
                
<span class="param-type">Error</span>


            </dd>
        </dl>
    </dt>
    <dd></dd>
</dl>


    







        
            

    

    
    <h4 class="name" id="verifyPrimaryUser"><span class="type-signature">(async) </span>verifyPrimaryUser<span class="signature">(verificationKeys<span class="signature-attributes">opt</span>, date<span class="signature-attributes">opt</span>, userID<span class="signature-attributes">opt</span>, config<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;{keyID: module:type/keyid~KeyID, valid: (Boolean|null)}>>}</span></h4>
    

    



<div class="description">
    <p>Verifies primary user of key</p>
<ul>
<li>if no arguments are given, verifies the self certificates;</li>
<li>otherwise, verifies all certificates signed with given keys.</li>
</ul>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>verificationKeys</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array.&lt;<a href="PublicKey.html">PublicKey</a>></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>array of keys to verify certificate signatures, instead of the primary key</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>date</code></td>
            

            <td class="type">
            
                
<span class="param-type">Date</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Use the given date for verification instead of the current time</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>userID</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>User ID to get instead of the primary user, if it exists</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>config</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Full configuration, defaults to openpgp.config</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js">key/key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js#L711">line 711</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>List of signer's keyID and validity of signature.
Signature validity is null if the verification keys do not correspond to the certificate.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise.&lt;Array.&lt;{keyID: module:type/keyid~KeyID, valid: (Boolean|null)}>></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="write"><span class="type-signature"></span>write<span class="signature">()</span><span class="type-signature"> &rarr; {Uint8Array}</span></h4>
    

    



<div class="description">
    <p>Returns binary encoded key</p>
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js">key/key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/key/key.js#L246">line 246</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>Binary key.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Uint8Array</span>


    </dd>
</dl>

    





        
    

    

    
</article>

</section>




</div>

<nav>
    <h2><a href="index.html">Home</a></h2><h3>Functions</h3><ul><li><a href="global.html#armor">armor</a></li><li><a href="global.html#createCleartextMessage">createCleartextMessage</a></li><li><a href="global.html#createMessage">createMessage</a></li><li><a href="global.html#decrypt">decrypt</a></li><li><a href="global.html#decryptKey">decryptKey</a></li><li><a href="global.html#decryptSessionKeys">decryptSessionKeys</a></li><li><a href="global.html#encrypt">encrypt</a></li><li><a href="global.html#encryptKey">encryptKey</a></li><li><a href="global.html#encryptSessionKey">encryptSessionKey</a></li><li><a href="global.html#generateKey">generateKey</a></li><li><a href="global.html#generateSessionKey">generateSessionKey</a></li><li><a href="global.html#readCleartextMessage">readCleartextMessage</a></li><li><a href="global.html#readMessage">readMessage</a></li><li><a href="global.html#readSignature">readSignature</a></li><li><a href="global.html#reformatKey">reformatKey</a></li><li><a href="global.html#revokeKey">revokeKey</a></li><li><a href="global.html#sign">sign</a></li><li><a href="global.html#unarmor">unarmor</a></li><li><a href="global.html#verify">verify</a></li></ul><h3>Modules</h3><ul><li><a href="module-config.html">config</a></li><li><a href="module-enums.html">enums</a></li></ul><h3>Classes</h3><ul><li><a href="AEADEncryptedDataPacket.html">AEADEncryptedDataPacket</a></li><li><a href="CleartextMessage.html">CleartextMessage</a></li><li><a href="CompressedDataPacket.html">CompressedDataPacket</a></li><li><a href="Key.html">Key</a></li><li><a href="LiteralDataPacket.html">LiteralDataPacket</a></li><li><a href="MarkerPacket.html">MarkerPacket</a></li><li><a href="Message.html">Message</a></li><li><a href="OnePassSignaturePacket.html">OnePassSignaturePacket</a></li><li><a href="PacketList.html">PacketList</a></li><li><a href="PaddingPacket.html">PaddingPacket</a></li><li><a href="PrivateKey.html">PrivateKey</a></li><li><a href="PublicKey.html">PublicKey</a></li><li><a href="PublicKeyEncryptedSessionKeyPacket.html">PublicKeyEncryptedSessionKeyPacket</a></li><li><a href="PublicKeyPacket.html">PublicKeyPacket</a></li><li><a href="PublicSubkeyPacket.html">PublicSubkeyPacket</a></li><li><a href="SecretKeyPacket.html">SecretKeyPacket</a></li><li><a href="SecretSubkeyPacket.html">SecretSubkeyPacket</a></li><li><a href="Signature.html">Signature</a></li><li><a href="SignaturePacket.html">SignaturePacket</a></li><li><a href="SymEncryptedIntegrityProtectedDataPacket.html">SymEncryptedIntegrityProtectedDataPacket</a></li><li><a href="SymEncryptedSessionKeyPacket.html">SymEncryptedSessionKeyPacket</a></li><li><a href="SymmetricallyEncryptedDataPacket.html">SymmetricallyEncryptedDataPacket</a></li><li><a href="TrustPacket.html">TrustPacket</a></li><li><a href="UserAttributePacket.html">UserAttributePacket</a></li><li><a href="UserIDPacket.html">UserIDPacket</a></li><li><a href="module-key_Subkey-Subkey.html">Subkey</a></li><li><a href="module-key_User-User.html">User</a></li></ul>
</nav>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a>
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>